<template>

    <div>
        <selectPosition ref="selectPositionWin" @afterSelectPosition="afterSelectPosition" />
    </div>
</template>

<script>
    import loadBMap from "@/components/loadBMap";
    import selectPosition from "@/components/map.vue";
    export default {
        components: {selectPosition},
        name: "map",
        data(){
            return{
                dataForm: {
                    mapLng: '',
                    mapLat: ''
                },
                form: {
                    address: "", // 详细地址
                    addrPoint: {
                        // 详细地址经纬度
                        lng: 0,
                        lat: 0,
                    },
                }
            }
        },
        async mounted(){
            await loadBMap()
            this.$refs.selectPositionWin.myMehod()
        },
        methods:{
            afterSelectPosition(data) {
                this.dataForm.mapLng = data.addrPoint.lng
                this.dataForm.mapLat = data.addrPoint.lat
            }
        }
    }
</script>

<style scoped>

</style>